extends Node
class_name Utils

# 初始化技能类
static func instatiate_class(path_of_class:String,name_of_class:String)->Object:
	var url = path_of_class + name_of_class+".gd"
	if ResourceLoader.exists(url):
		return load(url)
	return null

# 将字符串解析转换为字典，如deceleration,5,0.5|frostbite,5,30,转换成{"deceleration":[5,0.5],"frostbite":[5.30]}
static func parse_string_to_dictionary(string:String) -> Dictionary:
	var array = string.split("|")
	var dic = {}
	for item in array:
		var array1:Array = item.split(",")
		var id = array1[0].to_lower() # 转换成小写，id对应的脚本都是小写的
		array1.erase(id)
		dic[id] = array1
	return dic
